package cn.com.yusys.yusp.mobile.web.rest;

import cn.com.yusys.yusp.commons.web.rest.dto.ResultDto;
import cn.com.yusys.yusp.mobile.service.OcrmSMSModelInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
 * 短信
 * @author zoie
 */
@RestController
@RequestMapping("/mobile/ocrmSMSModelInfo")
public class OcrmSMSModelInfoResource {

    @Resource
    private OcrmSMSModelInfoService ocrmSMSModelInfoService;

    /**
     * 短信模版
     * @return
     */
    @GetMapping("/querySmsModelInfoList")
    @ApiOperation(value = "短信模版", notes = "短信模版")
    public ResultDto<List<Map<String,Object>>> querySmsModelInfoList() {
        return new ResultDto<>(ocrmSMSModelInfoService.querySmsModelInfoList());
    }

    /**
     * 短信发送
     * @return
     */
    @PostMapping("/sendMessage")
    @ApiOperation(value = "短信发送", notes = "短信发送")
    public ResultDto<Integer> sendMessage(@RequestBody Map map) {
        ocrmSMSModelInfoService.sendMessage(map);
        return new ResultDto<>();
    }

}